//
//  YXTimer.h
//  TASWork
//
//  Created by YUSIR on 2018/1/9.
//  Copyright © 2018年 YUSIR All rights reserved.
//

#import <Foundation/Foundation.h>

@interface YXTimer : NSObject

//返回YES 表示执行一次之后就关闭，否则检查其他参数
typedef BOOL (^AKCTimerTask)(void);

//重复执行/NO
@property(nonatomic,assign) BOOL repeat;
//fist run delay
@property(nonatomic,assign) NSTimeInterval delay;
//间隔 仅repeat=YES 时有效
@property(nonatomic,assign) NSTimeInterval interval;

//循环次数
@property(nonatomic,assign) int loopsNum;

- (instancetype)init:(AKCTimerTask)taskBlock;
- (instancetype)init:(AKCTimerTask)taskBlock repeat:(BOOL)isrepeat delay:(NSTimeInterval)timedelay interval:(NSTimeInterval)timeinterval;
- (instancetype)init:(AKCTimerTask)taskBlock repeat:(BOOL)isrepeat repeatLoops:(int)loops delay:(NSTimeInterval)timedelay interval:(NSTimeInterval)timeinterval;

- (void)start;
- (void)stop;

@end
